<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_版心与居中</title>
    <style>
        .card{
            width: 300px;
            height: 400px;
            border:5px solid #000;
            background-color: lightgoldenrodyellow;
            text-align: center;
            line-height: 400px;
            margin: 0 auto;

        }
        .center{
            width: 1000px;
            background-color: lavenderblush;
            margin: 0 auto;
        }
    </style>

</head>
<body>
<div class="main">
    <div class="center">
        <div class="card">我是内容</div>
        <div class="card">我是内容</div>
        <div class="card">我是内容</div>
        <div class="card">我是内容</div>

    </div>
</div>
</body>
</html>